Add new function which checks for the proper version of dotnet#1131
Closed
JamesWTruher wants to merge 1 commit intoPowerShell:developmentfrom
Closed
Add new function which checks for the proper version of dotnet#1131JamesWTruher wants to merge 1 commit intoPowerShell:developmentfrom
JamesWTruher wants to merge 1 commit intoPowerShell:developmentfrom
Conversation
This will improve the experience when the wrong version of dotnet is present by creating an error very early on in the process with a better error message
Now the developer will see something similar to the following:
```
PS /users/james/src/github/forks/JamesWTruher/PSScriptAnalyzer> ./build
Incorrect dotnet version: have '2.1.403' need '2.2.102'
At /users/james/src/github/forks/JamesWTruher/PSScriptAnalyzer/build.psm1:137 char:9
throw 'Incorrect dotnet version: have '' need ' ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CategoryInfo : OperationStopped: (Incorrect dotne... need '2.2.102':String) [], RuntimeException
FullyQualifiedErrorId : Incorrect dotnet version: have '2.1.403' need '2.2.102'
```
5ca5f85 to
062fd10
Compare
bergmeister
requested changes
Jan 21, 2019
Collaborator
There was a problem hiding this comment.
We need this to work on the WMF4 build as well (it doesn't at the moment) and we should also remove/move existing code here that is used for CI to avoid duplication. There is a lot of handling for major/minor version, why not use the --list-sdks option instead to avoid handling those scenarios and also to not make it fail and just install the exact required version? In terms of handling the error and minor/major versions, I think dotnet build does that already together with global.json, so we should rather try to just rather try to propagate this error from the layering between build.ps1 and build.psm1 to the user.
Contributor
Author
|
i'm closing this and will incorporate it into #1139 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This will improve the experience when the wrong version of dotnet is present by creating an error very early on in the process with a better error message
Now the developer will see something similar to the following:
PR Summary
PR Checklist
.cs,.ps1and.psm1files have the correct copyright headerWIP:to the beginning of the title and remove the prefix when the PR is ready.